package com.tansun.easycare.rule.deployonline.service;

import java.util.List;

import com.tansun.easycare.rule.common.service.RuleBaseService;
import com.tansun.easycare.rule.deployonline.entity.RuleDataInfo;
import com.tansun.easycare.rule.deployonline.entity.RuleDeployment;
import com.tansun.easycare.rule.deployonline.model.ReflactDataVO;
import com.tansun.easycare.rule.deployonline.model.RuleDeployVO;
import com.tansun.easycare.rule.exception.BizException;

public interface RuleDeployOnlineService extends RuleBaseService<RuleDeployment> {

    /**
     * 保存部署
     */
    void saveOrUpdate(RuleDeployVO ruleDeploy) throws BizException;

    /**
     * 执行表数据同步
     * @param id
     * @param projectCode
     * @throws Exception
     */
    void synchExeTable(String id,String projectCode) throws Exception;
    
    /**
     * 查找部署
     */
    RuleDeployVO findRuleDeploy(String id) throws BizException;

    /**
     * 删除部署
     */
    void deleteRuleDeploy(String id) throws BizException;

    /**
     * 创建部署文件
     */
    void createRulePackage(String deployCode, String userName, String projectCode) throws Exception;

    /**
     * 远程部署
     */
    RuleDeployment deployRemoteServer(String id,String  projectCode) throws Exception;
    
    /**
     * 执行远程部署
     */
    String runRemoteDeploy(RuleDeployment deployment) throws Exception;
    
    /**
     * 设置数据映射关系
     */
    int setReflactData(RuleDeployment deployment,ReflactDataVO reflactDataVO) throws Exception;
    
    /**
     * 远程部署
     * @param projectCode
     * @param deployCode
     * @return
     * @throws Exception
     */
    public RuleDataInfo getRulePackageData(String projectCode,String deployCode) throws Exception;

    /**
     *  审批完成后，将部署状态改为1 即已部署 ljt
     * @param deploymentIds
     * @return
     */
    public int updateStatusIndById(List<String> deploymentIds);
}
